-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(select): clear select if no option matches value #2110
Conversation
d9e0d5f
to
9acc0dc
Compare
Noticed a weird animation thing, want to look into it. Update: Seems like something that is being fixed in core. Creating a separate issue for it. |
* found with the designated value, the select trigger is cleared. | ||
*/ | ||
private _setSelectionByValue(value: any): void { | ||
this.options.forEach((option: MdOption) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need the type here, just
this.options.forEach(option => {
Should be equivalent
private _setSelectionByValue(value: any): void { | ||
this.options.forEach((option: MdOption) => { | ||
if (option.value === value) { | ||
option.select(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stop iterating if you find a value?
@jelbourn Comments addressed! |
* found with the designated value, the select trigger is cleared. | ||
*/ | ||
private _setSelectionByValue(value: any): void { | ||
const optionArr = this.options.toArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just options
- I have a strong aversion to suffixing with types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, changing!
LGTM otherwise |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Closes #2109
r: @jelbourn